<% content_for :header_tags do %>
    <%= stylesheet_link_tag 'issue_history_tabs', :plugin => 'redmine_issue_history_tabs' %>
<% end %>

<% reply_links = authorize_for('issues', 'edit') -%>
<% tabs = [
	{:label => :label_history_tab_all, :name => 'history_all'}, 
	{:label => :label_history_tab_comments, :name => 'history_comments'},
	] %> 
<% selected_tab = params[:tab] ? params[:tab].to_s : 'history_comments' %> 

<div class="tabs">
<ul>
<% tabs.each do |tab| -%>
    <li><%= link_to l(tab[:label]), { :tab => tab[:name] },
                                    :id => "tab-#{tab[:name]}",
                                    :class => (tab[:name] != selected_tab ? nil : 'selected'),
                                    :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li>
<% end -%>
</ul>
</div>

<% tabs.each do |tab| -%>
<%= content_tag('div', render(:partial => tab[:name], :locals => { :issue => issue,  :journals => journals, :reply_links => reply_links}), 
                       :id => "tab-content-#{tab[:name]}",
                       :style => (tab[:name] != selected_tab ? 'display:none' : nil),
                       :class => 'tab-content') %>
<% end -%>

